Owner of uploads directory is `www-data` but this prevents FTP access via PHP scripts
Posted
by letseatfood
on Server Fault
See other posts from Server Fault
or by letseatfood
Published on 2010-05-19T21:08:16Z
Indexed on
2010/05/19
21:10 UTC
Read the original article
Hit count: 315
To allow write access to Apache, I needed to chown www-data:www-data /var/www/mysite/uploads
to my site's upload folder. This allows me to delete files from the folder via unlink()
in a PHP script.
Unfortunately, this prevents another PHP script, which uses FTP functions, from working. I think it is because the FTP user is mike
and now that the uploads directory is owned by www-data
, mike
cannot access it.
I added mike
to the group www-data
, but this does not fix the issue.
Can somebody advise me on how to allow PHP FTP functions to work in addition to file deletion using PHP's unlink()
function?
© Server Fault or respective owner